<template>
    <div>
        列表
        <span @click="watchClick">监听数据改变</span>

    </div>

</template>
<script>
export default {
    data() {
        return {
            title: '0'
        }
    },
    created(){

    },
    mounted(){},
    watch: {
        title: {
            handler(newValue) {
                console.log(newValue);
            },
            deep: true, //深度监听
            immediate: true //页面在加载的时候就开始监听
        }
    },
    methods: {
        watchClick() {
            this.title = '1'
        }
    }
}
</script>
<style setup></style>